{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": [
     "remove-cell"
    ]
   },
   "outputs": [],
   "source": [
    "# Reference: https://jupyterbook.org/interactive/hiding.html\n",
    "# Use {hide, remove}-{input, output, cell} tags to hiding content\n",
    "\n",
    "import sys\n",
    "import os\n",
    "sys.path.append(os.path.abspath('../../..'))\n",
    "from textbook_utils import *"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(sec:class_summary)=\n",
    "# Summary\n",
    "\n",
    "In this chapter, we fit simple logistic regressions with one explanatory variable, but we can easily include other variables in the model by adding more features to our design matrix. For example, if some predictors are categorical, we can include them as one-hot encoded features. These ideas carry over directly from {numref}`Chapter %s <ch:linear>`. The technique of regularization ({numref}`Chapter %s <ch:risk>`) also applies to logistic regression. We will integrate all of these modeling techniques---including using a train-test split to assess the model and cross-validation to choose the threshold---in the case study in {numref}`Chapter %s <ch:fake_news>` that develops a model to classify fake news."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Logistic regression is a cornerstone in machine learning since it naturally\n",
    "extends to more complex models. For example, logistic regression is one of the\n",
    "basic components of a neural network. When the response variable has more than\n",
    "two categories, logistic regression can be extended to multinomial logistic\n",
    "regression. Another extension of logistic regression for modeling counts is\n",
    "called Poisson regression. These different forms of regression are related to\n",
    "maximum likelihood, where the underlying model for the response is binomial,\n",
    "multinomial, or Poisson, respectively, and the goal is to optimize the\n",
    "likelihood of the data over the parameters of the respective distribution. This\n",
    "family of models is also known as generalized linear models. In all of these\n",
    "scenarios, closed form solutions for minimizing loss don't exist, so\n",
    "optimization of the average loss relies on numerical methods, which we cover in\n",
    "the next chapter."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
